import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

/**
*@ClassName a
*@Description TODO
*@Author Windy
*@Date 2022/9/1 11:39
*@Version 1.0
**/
public class JdbcTemplateDemo {
    public static void main(String[] args) {
        DriverManagerDataSource dataSource = new DriverManagerDataSource();
        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
        dataSource.setUrl("jdbc:mysql:///spring");
        dataSource.setUsername("root");
        dataSource.setPassword("123456");

        JdbcTemplate jt = new JdbcTemplate();
        jt.setDataSource(dataSource);
        jt.execute("insert into account(name,money) values('Oneal',100.0)");
    }
}

